package com.turing.procedure.client.draw;

import com.turing.common.response.ResponseVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = "draw", path = "draw")
public interface DrawInnerService {

    @PostMapping("updateTaskVersion")
    ResponseVO< Integer > updateTaskVersion(@RequestParam("taskSn") String taskSn);

    @PostMapping("queryParentTask")
    String queryParentTask(@RequestParam("taskSn") String childTaskSn);

    @PostMapping( "queryParentTaskVersion" )
    Integer queryParentTaskVersion(@RequestParam("parentTaskSn") String parentTaskSn);

    @GetMapping( "getTaskTemplate" )
    String getTaskTemplate(@RequestParam("taskSn") String taskSn);

    @GetMapping( "getTaskName" )
    String getTaskName(@RequestParam("taskSn") String taskSn);

    @PostMapping("finishOCRTaskNotification")
    void finishOCRTaskNotification(@RequestParam("taskSn") String taskSn);

    @GetMapping("getElementRelations")
    List<Integer> getElementRelations(@RequestParam("eleSn") int eleSn);

    @GetMapping("needsJSON")
    boolean needsJSON(@RequestParam("templateSn") String templateSn);

    /**
     * 复制任务要素
     * @param taskSn    需要复制的任务id
     * @param newTaskSn 新的任务id
     * @return boolean
     * @author lcy
     * @date 2021/6/16 15:33
     **/
    @PostMapping("copyTask")
    ResponseVO<Boolean> copyTask(@RequestParam String taskSn, @RequestParam String newTaskSn, @RequestParam String newTemplateId);

    @PostMapping("removeBatch")
    ResponseVO<Object> removeBatch(@RequestBody List<String> taskSns);

}
